package com.huike.report.mapper;

import com.huike.clues.domain.vo.BusinessChangeStatisticsVO;
import com.huike.clues.domain.vo.ClueChangeStatisticsVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 首页统计分析的Mapper
 * @author Administrator
 *
 */
public interface ReportMapper {
	/**=========================================基本数据========================================*/
	/**
	 * 获取线索数量
	 * @param beginCreateTime	开始时间
	 * @param endCreateTime		结束时间
	 * @param username			用户名
	 * @return
	 */
	Integer getCluesNum(@Param("startTime") String beginCreateTime,
						@Param("endTime") String endCreateTime,
						@Param("username") String username);

	/**
	 * 获取商机数量
	 * @param beginCreateTime	开始时间
	 * @param endCreateTime		结束时间
	 * @param username			用户名
	 * @return
	 */
	Integer getBusinessNum(@Param("startTime") String beginCreateTime,
						   @Param("endTime") String endCreateTime,
						   @Param("username") String username);

	/**
	 * 获取合同数量
	 * @param beginCreateTime	开始时间
	 * @param endCreateTime		结束时间
	 * @param username			用户名
	 * @return
	 */
	Integer getContractNum(@Param("startTime") String beginCreateTime,
						   @Param("endTime") String endCreateTime,
						   @Param("username") String username);

	/**
	 * 获取合同金额
	 * @param beginCreateTime	开始时间
	 * @param endCreateTime		结束时间
	 * @param username			用户名
	 * @return
	 */
	Double getSalesAmount(@Param("startTime") String beginCreateTime,
						  @Param("endTime") String endCreateTime,
						  @Param("username") String username);



	Integer getCluesNumByToday(@Param("username") String username, @Param("date") String date);

	Integer getBusinessNumByToday(@Param("username") String username, @Param("date") String date);

	Integer getContractNumToday(@Param("username") String username, @Param("date") String date);

	Double getSalesAmountByToday(@Param("username") String username, @Param("date") String date);

    Integer getTofollowedCluesNum(@Param("beginCreateTime") String beginCreateTime,
								  @Param("endCreateTime") String endCreateTime,
								  @Param("username") String username);

	Integer getTofollowedBusinessNum(@Param("beginCreateTime") String beginCreateTime,
									 @Param("endCreateTime") String endCreateTime,
									 @Param("username") String username);

	Integer getToallocatedCluesNum(@Param("beginCreateTime") String beginCreateTime,
								   @Param("endCreateTime") String endCreateTime,
								   @Param("username") String username);

	Integer getToallocatedBusinessNum(@Param("beginCreateTime") String beginCreateTime,
									  @Param("endCreateTime") String endCreateTime,
									  @Param("username") String username);

	List<Map<String, Object>> getHotCourse(@Param("beginTime") String beginTime, @Param("endTime") String endTime);

	Integer getEveryNum(String date);

	Integer getAllNum(String date);

	Integer getAllCluesNum(@Param("beginTime") String beginTime, @Param("endTime") String endTime);

	Integer getEffectiveClueNum(@Param("beginTime") String beginTime, @Param("endTime") String endTime);

	Integer getAllBusinessNum(@Param("beginTime") String beginTime, @Param("endTime") String endTime);

	Integer getAllContractNum(@Param("beginTime") String beginTime, @Param("endTime") String endTime);

	List<BusinessChangeStatisticsVO> getBaseInfo(@Param("beginCreateTime") String beginCreateTime,
												 @Param("endCreateTime") String endCreateTime);

	Integer getAllbuNum(@Param("beginCreateTime") String beginCreateTime,
						@Param("endCreateTime") String endCreateTime);

    List<ClueChangeStatisticsVO> getClueBaseInfo(@Param("beginCreateTime") String beginCreateTime,
												 @Param("endCreateTime") String endCreateTime);


    /**=========================================今日简报========================================*/



	/**=========================================待办========================================*/

}
